package wili.attrMapping.core.del;

import java.util.Map;

import wili.attrMapping.core.Atts;
import wili.attrMapping.core.UserConf;
import wili.attrMapping.core.ValueMapingNode;

/**
 * 
 * @author weilai2@163.com
 *
 */
@SuppressWarnings("all")
abstract class OldNewAtts {
	public Atts oldObj;
	public Atts newObj;

	public OldNewAtts(Atts frombean, Atts toBean) {
		this.oldObj = frombean;
		this.newObj = toBean;

	}

	public Map<String, Object> mapOfFromBean__() {
		return null;// todo..
	}

	public Atts getTarget(boolean refresh, ValueMapingNode ruleRoot, UserConf conf) {
		if (newObj != null && !refresh)
			return newObj;
		ValueMapingNode ret = this.refreshTargetBean(ruleRoot, conf);
		return newObj;
	}

	protected abstract ValueMapingNode refreshTargetBean(ValueMapingNode ruleRoot, UserConf conf);

	public static void main(String[] args) {

	}
}
